
            <link href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
            <link href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap-theme.min.css" rel="stylesheet">
            <script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
        

<div style="width:200px;float:left;background:#f3f3f3;">
	        <?php
        $db = Db::table("category");

        switch('self')
        {
            case 'top':
                //顶级
            $data = $db->where('pid',0)->get();
            break;
            case 'self':
                //同级
            $pid = $db->where('id',$_GET['id'])->pluck('pid');
            $data = $db->where('pid',$pid)->get();
            break;
            case 'son':
            $data = $db->where('pid',$_GET['id'])->get();
            break;
        }
        foreach($data as $field):
            $field['url']="list_{$field['id']}.html";
            ?>
        
		<a href="<?php echo $field['url']?>"><?php echo $field['catname']?></a><br/>
	
        <?php endforeach;
    ?>
</div>

<div style="float:left;width:500px;">
	<h2><?php echo $cms['catname']?></h2>

	        <?php
        $db = Db::table('article');
        
        $count = $db->where("cid",5)->count('*');

        Page::row(1)->make($count);
        
        $limit =  Page::limit();

        $data = $db->where('cid',5)->limit($limit)->get();

        foreach($data as $field):
            $field['url']=U('Home/Index/article',array('id'=>$field['id']));;
            ?>
           
		<li>
			<a href="<?php echo $field['url']?>"><?php echo $field['title']?></a>
		</li>
	
        <?php endforeach;?>

	        <?php 
        $db = Db::table('article');

        $count = $db->where("cid",5)->count('*');

        echo Page::row(1)->make($count);
        ?>
</div>